//
//  BaseTableViewController.swift
//  LZGWB
//
//  Created by Leoi ZoengGit on 2016/12/17.
//  Copyright © 2016年 Leoi ZoengGit. All rights reserved.
//

import UIKit

class BaseTableViewController: UITableViewController {
    
    // 定义标记记录用户登录状态
    var isLogin = false
    
    // 访客视图
    var visitorView: VisitorView?
    
    override func loadView() {
        
        isLogin ? super.loadView() : setupVisitorView()
        
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

        
    }
    
    fileprivate func setupVisitorView() {
        // 1.创建访客视图
        visitorView = VisitorView.visitorView()
        
        view = visitorView
        
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.plain, target: self, action: #selector(loginBtnClick))
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.plain, target: self, action: #selector(registerBtnClick))
     
    }
    
    @objc fileprivate func loginBtnClick(_ btn: UIButton) {
        
    }
    
    @objc fileprivate func registerBtnClick(_ btn: UIButton) {
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}
